﻿using System.Data.SqlClient;
using System.Configuration;

namespace DataAccess
{

    /// <summary>
    /// This class is used to get connection string from web.config
    /// </summary>
    class SqlConnectionTool
    {
        private static readonly string SqlConnectionString =
            ConfigurationManager.ConnectionStrings["PersonalBlog"].ConnectionString;
        /// <summary>
        /// Gets the SQL connection.
        /// </summary>
        /// <returns></returns>
        public static SqlConnection GetSqlConnection()
        {
            return new SqlConnection(SqlConnectionString);
        }
    }
}
